var bdParse = require('../../bdParse/bdParse.js'); 
Page({
    
    onLoad: function (options) {
        console.log('onLoad_detail我进来了');
        console.log('art_id========'+options.art_id);
        var id=options.art_id;
        this.yys_artinfo(id);
    },

    //获取文章的资料
    yys_artinfo(id) {
        var timestamp = Date.parse(new Date());
        var that = this;
        //链接远程服务器
        swan.request({
            url: 'https://api.cndzys.com/index.php/yys_artinfo', 
            method: 'GET',
            data: { id: id },
            header: { 'content-type': 'application/json' },
            success: function (res) {
                that.setData({ data_art: res.data.data_art})
                that.setData({ data_art_xg: res.data.data_art_xg})
                var content=res.data.data_art.message;
                that.setData({ content:bdParse.bdParse('article', 'html', content, that, 5), })
            },
        });
    },
    
    articledetail(event) {
        var art_id = event.currentTarget.id
        swan.navigateTo({ url:'../articledetail/articledetail?art_id=' + art_id  });
    },

    doctor(event) {
        var doc_id = event.currentTarget.id
        swan.navigateTo({ url:'../doctor/doctor?doc_id=' + doc_id  });
    },

});
